home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 014 / unixsubs.arc / SUBS.TXT < prev   
Encoding:
Text File  |  1986-12-29  |  1.7 KB  |  51 lines

  1.                                                 SUBS.EXE
  2.  
  3.  
  4.                                                 Class: UNIX
  5.  
  6.  
  7. SUBstitute Strings
  8.  
  9. NAME
  10.     SUBS                        Substitute regular expressions in strings
  11.  
  12. SYNOPSIS
  13.     subs <reg exp> <replaced by> [<file>...]
  14.  
  15. DESCRIPTION
  16.     Subs is a Unix utility that permits the user to rearrange any string. It
  17.     uses Unix regualr expressions. A regular expression is a text string that
  18.     provides for the selection and modication of very specific strings. As
  19.     with most Unix utiltiies subs will accept stdin instead of a file. This
  20.     permits subs to be used with strings piped from another program.
  21.  
  22. OPTIONS
  23.     There are no options with subs.
  24.  
  25. EXAMPLES
  26.     The best way to learn about subs is to try it. Since it can use stdin
  27.     instead of files you can type a string in and see the changes if it
  28.     matches the search string.
  29.                 
  30.                 subs test tested
  31.     
  32.     If you type in the word test it will be changed to tested.
  33.     testing will be changed to testeding but Test will not be changed.
  34.     Subs is case sensitive.
  35.     
  36.  
  37.     Please refer to the text file on regular expressions of additional
  38.     uses of subs.
  39.  
  40.     Grep and subs make excellent partners. Use grep to find strings and
  41.     subs to alter them.
  42.  
  43.             lc test.c | grep ^Warning | subs "\(Warning \)\(.*\)" "\2\"
  44.  
  45.     This is a fairly complex use of grep and subs. In this case all output
  46.     from the compiler with the word Warning at the start of the line will be
  47.     picked out by grep and passed to subs. Subs will remove the first region
  48.     leaving only the text that follows the warning. Great for making impromptu
  49.     reports.
  50.     
  51.